import { defineStore } from "pinia";
import { getUserInfo } from "@/api/user";
export const userStore = defineStore({
  id: "user",
  state: () => ({
    userInfo: { id: 1, name: "admin" },
  }),
  actions: {
    async fetchUserInfo(data) {
      // 获取菜单列表
      console.log("store", this.userInfo);
      try {
        let result = await getUserInfo(data);
        if (result.status == 200) {
          this.userInfo = result.data;
        }
      } catch (error) {}
    },
  },
});
